<!--
 * @Author: sundeqi
 * @Date: 2022-03-28 17:27:18
 * @LastEditors: sundeqi
 * @LastEditTime: 2022-03-30 19:10:06
 * @Description: 直播入口
-->

<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<meta name="viewport"
		content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<title>Live Stream</title>
	<!--[if IE]><script src="js/excanvas.js"></script><![endif]-->
	<script>
		window.onload = function () {
			//var query = window.location.search.substring(1);
			var videoId = '2mCSYvcfhtc';
			loadSrc(videoId, true);

			var bgDiv = document.getElementsByClassName('upcoming-bg')[0];
			bgDiv.style.backgroundImage = 'url("https://img.staticbg.com/banggood/infllive/20220301213813_128.jpg")';
		};

		function loadSrc(videoId, enableChat) {
			//showinfo=0 被弃用
			var chatIframe = document.getElementById('liveChatFrame');
			var videoIframe = document.getElementById('gkbLiveFrame')
			if (enableChat) {
				var domain = window.location.hostname;
				chatIframe.src = 'https://www.youtube.com/live_chat?v=' + videoId +
					'&embed_domain=' + domain;
			} else {
				//chatIframe.style.display = 'none';
				//videoIframe.setAttribute('style', 'height: 100px !important');
			}
			videoIframe.src = 'https://www.youtube.com/embed/' + videoId +
				'?autoplay=1&controls=0&iv_load_policy=3&modestbranding=1&rel=0&enablejsapi=1';

		}
	</script>
	<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
	<div class="container-bg">
		<div class="upcoming-bg"></div>
		<div class="live-box" style="display: flex;flex-direction: column;">
			<div class="adapting-video">
				<iframe id="gkbLiveFrame" align="top" width="100%" src="" title="YouTube video player" frameborder="0"
					allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
					data-gtm-yt-inspected-1_19="true"></iframe>
			</div>
			<iframe id="liveChatFrame" align="top" width="100%" style="flex: 1;" src="" frameborder="0"></iframe>
		</div>
	</div>
</body>

</html>